/**
 * @description 路由拦截状态管理，目前两种模式：all模式与intelligence模式，其中partialRoutes是菜单暂未使用
 */
import { defineStore } from 'pinia'
import type { themesState, themeConfigState } from '@/types/theme'
import mould1 from '@/common/theme/mould1'

export const themesStore = defineStore('theme', {
  state: (): themesState => ({
    themeConfig: JSON.parse(JSON.stringify(mould1.themeConfig))
  }),
  getters: {
    getThemeConfig: state => state.themeConfig,
    getAnimation: state => state.themeConfig.animation,
    getNavTwoWidth: state => state.themeConfig.menu.navtwo.width,
    getTopNavIsClose: state => state.themeConfig.menu.navtop.isClose
  },
  actions: {
    /**
     * @description 设置默认值
     * @param themeConfig
     * */
    setConfirmTheme(themeConfig: themeConfigState) {
      this.themeConfig = themeConfig
    }
  }
})
